package com.uchedao.vehicledetection.loadstate.listview.swiperefresh;

import android.annotation.SuppressLint;
import android.content.Context;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;

import com.uchedao.vehicledetection.R;

/**
 * 下来刷新
 * 
 * @author wushan
 * 
 */
public class ReSwipeRefreshLayout extends SwipeRefreshLayout {

	public ReSwipeRefreshLayout(Context context, AttributeSet attrs) {
		super(context, attrs);
		init();
	}

	public ReSwipeRefreshLayout(Context context) {
		super(context);
		init();
	}

	@SuppressLint("ResourceAsColor")
	private void init() {

		setColorScheme(R.color.swipe_refresh_color);
		// 设置下拉圆圈上的颜色，蓝色、绿色、橙色、红色
		setColorSchemeResources(R.color.common_pink);
		setDistanceToTriggerSync(100);// 设置手指在屏幕下拉多少距离会触发下拉刷新
		setProgressBackgroundColor(R.color.light_black);// 设置下拉圆圈的背景
		setSize(SwipeRefreshLayout.LARGE);
	}
}
